{{#* inline 'getViewDataModel' container}}
{{#if container.psAppViewLogics}}
	{{#each container.psAppViewLogics as | viewLogic |}}
    {{#and viewLogic.name 'opendata' viewLogic.psAppUILogic viewLogic.psAppUILogic.openDataPSAppView viewLogic.psAppUILogic.openDataPSAppView.refPSAppView}}
openData: {
  deCodeName: '{{#if viewLogic.psAppUILogic.openDataPSAppView.refPSAppView.psAppDataEntity}}{{lowerCase viewLogic.psAppUILogic.openDataPSAppView.refPSAppView.psAppDataEntity.codeName}}{{/if}}',
  openDataViewName: '{{viewLogic.psAppUILogic.openDataPSAppView.refPSAppView.codeName}}',
      {{#if viewLogic.psAppUILogic.openDataPSAppView.psNavigateContexts}}
  navContext:"{{> @macro/common/navparam.hbs appNavParams=viewLogic.psAppUILogic.openDataPSAppView.psNavigateContexts}}",
      {{/if}}
      {{#if viewLogic.psAppUILogic.openDataPSAppView.psNavigateParams}}
  navViewParams:"{{> @macro/common/navparam.hbs appNavParams=viewLogic.psAppUILogic.openDataPSAppView.psNavigateParams}}",
      {{/if}}
},
    {{/and}}
    {{#and viewLogic.name 'newdata' viewLogic.psAppUILogic viewLogic.psAppUILogic.newDataPSAppView viewLogic.psAppUILogic.newDataPSAppView.refPSAppView}}
newData: {
  deCodeName: '{{#if viewLogic.psAppUILogic.newDataPSAppView.refPSAppView.psAppDataEntity}}{{lowerCase viewLogic.psAppUILogic.newDataPSAppView.refPSAppView.psAppDataEntity.codeName}}{{/if}}',
  newDataViewName: '{{viewLogic.psAppUILogic.newDataPSAppView.refPSAppView.codeName}}',
      {{#if viewLogic.psAppUILogic.newDataPSAppView.psNavigateContexts}}
  navContext:"{{> @macro/common/navparam.hbs appNavParams=viewLogic.psAppUILogic.newDataPSAppView.psNavigateContexts}}",
      {{/if}}
      {{#if viewLogic.psAppUILogic.newDataPSAppView.psNavigateParams}}
  navViewParams:"{{> @macro/common/navparam.hbs appNavParams=viewLogic.psAppUILogic.newDataPSAppView.psNavigateParams}}",
      {{/if}}
  entityName: '{{viewLogic.psAppUILogic.newDataPSAppView.refPSAppView.psAppDataEntity.codeName}}'
},
    {{/and}}
	{{/each}}
{{/if}}
{{/inline}}
import { IEditViewModel } from "@/core/interface/view/model";
function getModel(): IEditViewModel {
  return {
    caption: "{{page.caption}}",
    title: "{{page.title}}",
    capPSLanguageRes: "{{page.capPSLanguageRes.lanResTag}}",
    titlePSLanguageRes: "{{page.titlePSLanguageRes.lanResTag}}",
    showDataInfoBar: {{#if page.showDataInfoBar}}true{{else}}false{{/if}},
    codeName: '{{page.codeName}}',
    ctrls: [
    {{#if (and page.psViewLayoutPanel page.psViewLayoutPanel.psControls)}}
      {{#each page.psViewLayoutPanel.psControls as | ctrl |}}
      {
        name: '{{ctrl.name}}',
        codeName: '{{ctrl.codeName}}',
        controlType: '{{ctrl.controlType}}',
        {{#if ctrl.userTag}}
        userTag: '{{ctrl.userTag}}',
        {{/if}}
      }{{#unless @last}},{{/unless}}
      {{/each}}
    {{else}}
      {{#if page.ctrls}}
        {{#each page.ctrls as | ctrl |}}
      {
        name: '{{ctrl.name}}',
        codeName: '{{ctrl.codeName}}',
        controlType: '{{ctrl.controlType}}',
        {{#if ctrl.userTag}}
        userTag: '{{ctrl.userTag}}',
        {{/if}}
      }{{#unless @last}},{{/unless}}
        {{/each}}
      {{/if}}
    {{/if}}
    ],
    {{#if page.psViewLayoutPanel.useDefaultLayout}}
    cssName: "{{#if page.psSysCss}}{{page.psSysCss.cssName}}{{/if}}",
    {{else}}
    cssName: "{{#if page.psViewLayoutPanel.psSysCss}}{{page.psViewLayoutPanel.psSysCss.cssName}}{{/if}}",
    {{/if}}
    name: "{{page.name}}",
    viewType: "{{page.viewType}}",
    viewStyle: "{{page.viewStyle}}",
    showCaption: {{#if page.showCaptionBar}}true{{else}}false{{/if}},
    isLoadDefault: {{#if page.loadDefault}}true{{else}}false{{/if}},
    {{#if page.psAppDataEntity}}
    entityCodeName: "{{page.psAppDataEntity.codeName}}",
    keyPSAppDEField: "{{page.psAppDataEntity.keyPSAppDEField.codeName}}",
    majorPSAppDEField: "{{page.psAppDataEntity.majorPSAppDEField.codeName}}",
    {{/if}}
    {{#if page.enableQuickSearch}}
    enableQuickSearch: true,
    {{/if}}
    expandSearchForm:{{#if page.expandSearchForm}}true{{else}}false{{/if}},
    {{#and page.enableQuickGroup page.quickGroupPSCodeList}}
    enableQuickGroup: true,
    quickGroupCodeList: "{{page.quickGroupPSCodeList.codeListTag}}",
    {{/and}}
    {{!-- 存在视图布局面板，且是视图代理模式 --}}
    {{#and page.psViewLayoutPanel (eq page.psViewLayoutPanel.useDefaultLayout false) page.psViewLayoutPanel.viewProxyMode}}
    {{> getViewDataModel container=page.psViewLayoutPanel}}
    {{else}}
    {{> getViewDataModel container=page}}
    {{/and}}
    {{#page.ctrls}}
      {{#eq controlType 'TOOLBAR'}}
        {{#and userTag (eq userTag 'VIEW')}}
    toolbarItems_view: [
      {{> @macro/widgets/toolbar/toolbar-item.hbs items=psDEToolbarItems view=page toolbar=this}}
    ],
        {{else}}
    toolbarItems_edit: [
      {{> @macro/widgets/toolbar/toolbar-item.hbs items=psDEToolbarItems view=page toolbar=this}}
    ],
        {{/and}}
      {{/eq}}
    {{/page.ctrls}}
    {{#if page.xDataControlName}}
    xDataCtrlName: "{{page.xDataControlName}}",
    {{/if}}
    {{!-- {{#if page.psAppViewMsgGroup}}
    viewMsgGroupName: "{{page.psAppViewMsgGroup.codeName}}",
    {{/if}} --}}
    {{> @macro/common/counter.hbs page=page}}
    {{#if page.psViewLayoutPanel}}
    useDefaultLayout: {{page.psViewLayoutPanel.useDefaultLayout}},
    quickSearchPlaceholder: "{{#if page.psAppDataEntity}}{{#each page.psAppDataEntity.allPSAppDEFields as | field | }}{{#if field.enableQuickSearch}}{{field.logicName}}{{#unless @last}},{{/unless}}{{/if}}{{/each}}{{/if}}",
    {{/if}}
  }
}
export const model = getModel();